// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store/index'

// 引入css
require ('../static/css/index.css')
// 全局引入
import  { ToastPlugin ,ConfirmPlugin ,LoadingPlugin} from 'vux'
Vue.use(ToastPlugin);
Vue.use(ConfirmPlugin);
Vue.use(LoadingPlugin);

Vue.config.productionTip = false

/* eslint-disable no-new */

router.beforeEach((to, from, next) => {
  if (to.meta.requiresId) {
    store.dispatch("isLogin");
  }
  next();
})

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
